<template>
    <Layout>
        <Form ref="form1" :model="form1" :label-width="120">
            <Row class="query-form" style="padding-top: 15px">
                <Col span="8">
                    <FormItem label="是否验证:">
                        <Select v-model="form1.ifverify" @on-change="changeSelect">
                            <Option value="1">已验证</Option>
                            <Option value="0">未验证</Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="检查名称:">
                        <Input type="text" v-model="form1.taskName"/>
                    </FormItem>
                </Col>
                <Col span="8">
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button type="primary" class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
            </Row>
        </Form>

        <Table ref='table'  :loading="loading" size="small" :height="tableHeight" class="table" no-data-text="没有查询到相关数据!"
               highlight-row stripe border :columns="columns1" width="100%" :data="dataTable">
        </Table>

        <Row style="margin-right:10px;">
            <Col span="24">
                <Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize"
                      @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray"
                      show-total show-sizer show-elevator/>
            </Col>
        </Row>
        <Modal title="问题验证" :transfer=false  v-model="model1" :width=1000>
            <Form ref="dataForm" :model="dataForm" :label-width="120" :rules="ruleCustom">
                <Row>
                    <Col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left">问题基本信息</Divider>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="检查名称:" prop="taskName">
                            {{chkProblem.taskName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="存在单位:" prop="existOrgName">
                            {{chkProblem.existOrgName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="检查人:" prop="reportUserName">
                            {{chkProblem.reportUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="检查日期:" prop="reportDate">
                            {{chkProblem.reportDate}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="11">
                        <FormItem label="问题类型:" prop="problemType">
                            {{chkProblem.problemType=='1'?'基础管理' : '现场管理'}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="问题状态:" prop="reportStatus">
                            {{chkProblem.reportStatusName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="问题图片:" prop="reportFile">
                            <div class="demo-upload-list" v-for="item in uploadList" :key="item.id">
                                <img :src="item.url">
                                <div class="demo-upload-list-cover">
                                    <Icon type="ios-eye-outline" @click.native="handleView(item.name,item.url)"></Icon>
                                </div>
                            </div>
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="问题描述:" prop="reportDesc">
                            {{chkProblem.reportDesc}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="要求整改时间:">
                            {{chkProblem.rectifyDate}}
                        </FormItem>
                    </Col>
                </Row>
               <!-- <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="备注:" prop="notes">
                            {{chkProblem.notes}}
                        </FormItem>
                    </Col>
                </Row>-->
               <!-- <Row>
                    <Col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left">问题审核信息</Divider>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="审核人:" prop="assignUserId">
                            {{chkAssign.assignUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="审核日期:" prop="assignDate">
                            {{chkAssign.assignDate}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="11">
                        <FormItem label="整改人:" prop="expectUser">
                            {{chkAssign.expectUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="整改期限:" prop="expectDate">
                            {{chkAssign.expectDate}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="整改要求:" prop="expectRect">
                            {{chkAssign.expectRect}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="审核图片:" prop="reportFile">
                            <div class="demo-upload-list" v-for="item in auditImgs" :key="item.id">
                                <img :src="item.url">
                                <div class="demo-upload-list-cover">
                                    <Icon type="ios-eye-outline" @click.native="handleView(item.name,item.url)"></Icon>
                                </div>
                            </div>
                        </FormItem>
                    </Col>
                </Row>-->
                <!-- <Row>
                     <Col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                         <Divider orientation="left">问题历史整改信息</Divider>
                     </Col>
                 </Row>-->
                <Row>
                    <Col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left">问题整改信息</Divider>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="整改人:" prop="rectifyUser">
                            {{chkRectify.rectifyUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="参与人:" prop="rectifyPersion">
                            {{chkRectify.rectifyPersion}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="11">
                        <FormItem label="整改开始日期:" prop="rectifyDate">
                            {{chkRectify.rectifyDate}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="整改结束日期:" prop="expirationTime">
                            {{chkRectify.expirationTime}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="整改情况描述:" prop="rectifyDesc">
                            {{chkRectify.rectifyDesc}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="11">
                        <FormItem label="整改期限:" prop="expectDate">
                            {{chkAssign.expectDate}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="验证人:" prop="verifier">
                            {{chkRectify.verifierName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="整改图片:" prop="reportFile">
                            <div class="demo-upload-list" v-for="item in chkRectify.fileIds" :key="item">
                                <img :src="filesUrl + '/' + item">
                                <div class="demo-upload-list-cover">
                                    <Icon type="ios-eye-outline" @click.native="handleView(item,filesUrl + '/' + item)"></Icon>
                                </div>
                            </div>
                        </FormItem>
                    </Col>
                </Row>

                <Row>
                    <Col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left">问题验证信息</Divider>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="验证人:" prop="verifier">
                            <userDom ref="childUser1" @setUserInfo="setVerifierId" :selectData="{userName: setCurrentVerifierName.label}"></userDom>
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="验证日期:" prop="verifyDate">
                            <DatePicker  type="date" style="width: 100%"  format="yyyy-MM-dd" v-model="dataForm.verifyDate"></DatePicker>
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="整改结果:" prop="verifyResult">
                            <Select  v-model="dataForm.verifyResult">
                                <Option value="1" >通过</Option>
                                <Option value="0" >不通过</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="11" v-if="dataForm.verifyResult=='1'">
                        <FormItem label="关闭日期:" prop="closedDate">
                            <DatePicker readonly type="date" style="width: 100%"  format="yyyy-MM-dd" v-model="dataForm.closedDate"></DatePicker>
                        </FormItem>
                    </Col>
                    <Col span="11" v-else>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="验证情况描述:" prop="verifyDesc">
                            <Input v-model="dataForm.verifyDesc" type="textarea" :autosize="{minRows: 3,maxRows: 5}"/>
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="验证图片：">
                            <div class="demo-upload-list" v-for="(item, index) in fileList" :key="index">
                                <template>
                                    <img :src="item.imgBase64">
                                    <div class="demo-upload-list-cover">
                                        <Icon type="ios-eye-outline" @click.native="handleView(item.name,item.imgBase64)"></Icon>
                                        <Icon type="ios-trash-outline" @click.native="handleRemove1(item.keyID)"></Icon>
                                    </div>
                                </template>
                            </div>
                            <div class="demo-upload-list" v-for="item in uploadImgs" :key="item.id">
                                <img :src="item.url">
                                <div class="demo-upload-list-cover">
                                    <Icon type="ios-eye-outline" v-if="item.url" @click.native="handleView(item.name,item.url)"></Icon>
                                    <Icon type="ios-trash-outline" v-if="!editable"></Icon>
                                    <Icon type="ios-trash-outline" v-else @click.native="handleRemove(item)"></Icon>
                                </div>
                            </div>
                            <Upload
                                    ref="upload"
                                    :show-upload-list="false"
                                    :format="['jpg','jpeg','png']"
                                    :max-size="1024"
                                    :on-format-error="handleFormatError"
                                    :on-exceeded-size="handleMaxSize"
                                    :before-upload="handleBeforeUpload"
                                    multiple
                                    type="drag"
                                    :action="upUrl"
                                    :disabled="!editable"
                                    style="display: inline-block;width:58px;">
                                <div style="width: 58px;height:58px;line-height: 58px;">
                                    <Icon type="ios-camera" size="20"></Icon>
                                </div>
                            </Upload>
                        </FormItem>
                    </Col>
                </Row>
            </Form>
            <div slot="footer">
                <Button type="primary" class='ivu-btn-save' :loading="buttonLoading" @click="saveData('2')"  style="margin-left: 6px">提交</Button>
                <!--<Button type="primary" class='ivu-btn-save' :loading="buttonLoading" @click="saveData('1')"  style="margin-left: 2px">确定</Button>-->
                <Button type="primary" class='ivu-btn-cancel' @click="handleCancel"  style="margin-left: 2px">取消</Button>
            </div>
        </Modal>

        <Modal title="问题查看" :transfer=false class="modal-view-detail" v-model="viewModal" :width=900>
            <Form ref="viewForm" :label-width="100">
                <Row>
                    <Col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left"><span style="font-size:18px;color:#464c5b;font-weight: bold">问题基本信息</span></Divider>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="检查名称:" prop="taskName">
                            {{chkProblem.taskName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="存在单位:" prop="existOrgName">
                            {{chkProblem.existOrgName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="检查人:" prop="reportUserName">
                            {{chkProblem.reportUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="检查日期:" prop="reportDate">
                            {{chkProblem.reportDate}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="问题类型:" prop="problemType">
                            {{chkProblem.problemType=='1'?'基础管理' : '现场管理'}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="问题状态:" prop="reportStatus">
                            {{chkProblem.reportStatusName}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="问题图片:" prop="reportFile">
                            <div class="demo-upload-list" v-for="item in uploadList" :key="item.id">
                                <img :src="item.url">
                                <div class="demo-upload-list-cover">
                                    <Icon type="ios-eye-outline" @click.native="handleView(item.name,item.url)"></Icon>
                                </div>
                            </div>
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="问题描述:" prop="reportDesc">
                            {{chkProblem.reportDesc}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="要求整改时间:">
                            {{chkProblem.rectifyDate}}
                        </FormItem>
                    </Col>
                </Row>
                <!--<Row type="flex" justify="space-around" class="code-row-bg">-->
                    <!--<Col span="23">-->
                        <!--<FormItem label="备注:" prop="notes">-->
                            <!--{{chkProblem.notes}}-->
                        <!--</FormItem>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row>
                    <Col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left"><span style="font-size:18px;color:#464c5b;font-weight: bold">问题审核信息</span></Divider>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                        <FormItem label="审核人:" prop="assignUserId">
                            {{chkAssign.assignUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="审核日期:" prop="assignDate">
                            {{chkAssign.assignDate}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="11">
                        <FormItem label="整改人:" prop="expectUser">
                            {{chkAssign.expectUserName}}
                        </FormItem>
                    </Col>
                    <Col span="11">
                        <FormItem label="整改期限:" prop="expectDate">
                            {{chkAssign.expectDate}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem label="整改要求:" prop="expectRect">
                            {{chkAssign.expectRect}}
                        </FormItem>
                    </Col>
                </Row>
                <Row type="flex" justify="space-around" class="detail-background-clor">
                    <Col span="23">
                        <FormItem label="审核图片:" prop="reportFile">
                            <div class="demo-upload-list" v-for="item in auditImgs" :key="item.id">
                                <img :src="item.url">
                                <div class="demo-upload-list-cover">
                                    <Icon type="ios-eye-outline" @click.native="handleView(item.name,item.url)"></Icon>
                                </div>
                            </div>
                        </FormItem>
                    </Col>
                </Row>-->
                <Row v-if="bohui.length > 0">
                    <Col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                        <Divider orientation="left"><span style="font-size:18px;color:#464c5b;font-weight: bold">问题整改历史信息</span></Divider>
                    </Col>
                </Row>
                <div v-for="(item,index) in bohui" :key="index">
                    <Row>
                        <Col span="24" style="font-size:18px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">第{{index+1}}次整改</span></Divider>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改人:" prop="rectifyUser">
                                {{item.chkRectify.rectifyUserName}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="参与人:" prop="rectifyPersion">
                                {{item.chkRectify.rectifyPersion}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改开始日期:" prop="rectifyDate">
                                {{item.chkRectify.rectifyDate}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="整改结束日期:" prop="expirationTime">
                                {{item.chkRectify.expirationTime}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="整改情况描述:" prop="rectifyDesc">
                                {{item.chkRectify.rectifyDesc}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="验证人:" prop="verifier">
                                {{item.chkRectify.verifierName}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="整改图片:" prop="reportFile">
                                <div class="demo-upload-list" v-for="obj in item.chkRectify.fileIds" :key="obj">
                                    <img :src="filesUrl + '/' + obj">
                                    <div class="demo-upload-list-cover">
                                        <Icon type="ios-eye-outline" @click.native="handleView(obj,filesUrl + '/' + obj)"></Icon>
                                    </div>
                                </div>
                            </FormItem>
                        </Col>
                    </Row>
                    <Row>
                        <Col span="24" style="font-size:18px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">第{{index+1}}次验证</span></Divider>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="验证人:" prop="verifier">
                                {{item.chkVerify.verifierName}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="验证日期:" prop="verifyDate">
                                {{item.chkVerify.verifyDate}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改结果:" prop="verifyResult">
                                {{item.chkVerify.verifyResult=='1'?'通过':item.chkVerify.verifyResult=='0'?'不通过':''}}
                            </FormItem>
                        </Col>
                        <Col span="11" v-if="item.chkVerify.verifyResult=='1'">
                            <FormItem label="关闭日期:" prop="closedDate">
                                {{item.chkVerify.closedDate}}
                            </FormItem>
                        </Col>
                        <Col span="11" v-else> </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="验证情况描述:" prop="verifyDesc">
                                {{item.chkVerify.verifyDesc}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="验证图片:" prop="reportFile">
                                <div class="demo-upload-list" v-for="obj in item.chkVerify.fileIds" :key="obj">
                                    <img :src="filesUrl + '/' + obj">
                                    <div class="demo-upload-list-cover">
                                        <Icon type="ios-eye-outline" @click.native="handleView(obj,filesUrl + '/' + obj)"></Icon>
                                    </div>
                                </div>
                            </FormItem>
                        </Col>
                    </Row>
                </div>

                <div v-if="bohui.length == 0">
                    <Row>
                        <Col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">问题整改信息</span></Divider>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改人:" prop="rectifyUser">
                                {{chkRectify.rectifyUserName}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="参与人:" prop="rectifyPersion">
                                {{chkRectify.rectifyPersion}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改开始日期:" prop="rectifyDate">
                                {{chkRectify.rectifyDate}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="整改结束日期:" prop="expirationTime">
                                {{chkRectify.expirationTime}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="整改情况描述:" prop="rectifyDesc">
                                {{chkRectify.rectifyDesc}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改期限:" prop="expectDate">
                                {{chkAssign.expectDate}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="验证人:" prop="verifier">
                                {{chkRectify.verifierName}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="整改图片:" prop="reportFile">
                                <div class="demo-upload-list" v-for="item in chkRectify.fileIds" :key="item">
                                    <img :src="filesUrl + '/' + item">
                                    <div class="demo-upload-list-cover">
                                        <Icon type="ios-eye-outline" @click.native="handleView(item,filesUrl + '/' + item)"></Icon>
                                    </div>
                                </div>
                            </FormItem>
                        </Col>
                    </Row>
                    <Row>
                        <Col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">问题验证信息</span></Divider>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="验证人:" prop="verifier">
                                {{viewForm.verifierName}}
                            </FormItem>
                        </Col>
                        <Col span="11">
                            <FormItem label="验证日期:" prop="verifyDate">
                                {{viewForm.verifyDate}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="11">
                            <FormItem label="整改结果:" prop="verifyResult">
                                {{viewForm.verifyResult=='1'?'通过':viewForm.verifyResult=='0'?'不通过':''}}
                            </FormItem>
                        </Col>
                        <Col span="11" v-if="viewForm.verifyResult=='1'">
                            <FormItem label="关闭日期:" prop="closedDate">
                                {{viewForm.closedDate}}
                            </FormItem>
                        </Col>
                        <Col span="11" v-else></Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="验证情况描述:" prop="verifyDesc">
                                {{viewForm.verifyDesc}}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                            <FormItem label="验证图片:" prop="reportFile">
                                <div class="demo-upload-list" v-for="item in viewForm.fileIds" :key="item">
                                    <img :src="filesUrl + '/' + item">
                                    <div class="demo-upload-list-cover">
                                        <Icon type="ios-eye-outline" @click.native="handleView(item,filesUrl + '/' + item)"></Icon>
                                    </div>
                                </div>
                            </FormItem>
                        </Col>
                    </Row>
                </div>
               <!-- <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem>
                            <Button class='ivu-btn-save' @click="viewModal=false">关闭</Button>
                        </FormItem>
                    </Col>
                </Row>-->
            </Form>
            <div slot="footer">
                <Button class='ivu-btn-save' @click="viewModal=false">关闭</Button>
            </div>
        </Modal>
        <Modal  v-model="visible">
            <img :src="viewUrl" v-if="visible" style="width: 100%">
            <div slot="footer">
                <Button type="primary" class='ivu-btn-save'  @click="visible=false">关闭</Button>
            </div>
        </Modal>
    </layout>
</template>

<script>
    import {Api} from '../../../../api/index.js'
    import cascaderDom from '../../../../components/cascader-dom'
    import {sessionStorage} from '../../../../common/cacheUtils.js';
    import userDom from "@/views/safe/assessment/inputUser.vue"

    export default {
        components: {
            cascaderDom,
            userDom
        },
        data() {
            const verifierVal = (rule, value, callback) => {
                if(this.dataForm.verifier !== null && this.dataForm.verifier !== undefined ) {
                    callback();
                } else {
                    callback(new Error(' '));
                }
            };
            return {
                form1: {ifverify:'0'},
                dataForm: {},
                chkProblem : {},
                chkAssign : {},
                chkRectify : {},
                bohui : {},
                //分页参数
                pageSizeArray: [10, 20, 50],
                pagedata: {
                    total: 0,
                    pageSize: 10,
                    currentPage: 1,
                },
                columns1: [
                    {
                        title: "序号",
                        width: 80,
                        align: "center",
                        fixed:'left',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata.currentPage - 1) * this.pagedata.pageSize + 1);
                        }
                    },
                    /*{
                        minWidth: 220,
                        title: '检查名称',
                        key: 'taskName',
                        align: 'center'
                    },
                    {
                        minWidth: 100,
                        title: '检查人',
                        key: 'reportUserName',
                        align: 'center'
                    },
                    {
                        minWidth: 130,
                        title: '检查日期',
                        key: 'reportDate',
                        align: 'center'
                    },
                    {
                        minWidth: 180,
                        title: '存在单位',
                        key: 'existOrgName',
                        align: 'center'
                    },*/
                   /* {
                        minWidth: 100,
                        title: '问题类型',
                        align: 'center',
                        key: 'problemType',
                        render: (h, params) => {
                            if(params.row.problemType == '1'){
                                return h('span',{ },'基础管理')
                            }else if(params.row.problemType == '2'){
                                return h('span',{ },'现场管理')
                            }
                        }
                    },*/
                    {
                        minWidth: 180,
                        title: '问题描述',
                        key: 'reportDesc',
                        align: 'center',
                        tooltip:true
                       /* render: (h, params) => {
                            return h('div', [
                                h('span', (params.row.reportDesc && params.row.reportDesc.length) < 10 ?
                                    params.row.reportDesc : params.row.reportDesc.substr(0, 9) + '...')
                            ]);
                        }*/
                    },
                    {
                        minWidth: 100,
                        title: '整改人',
                        key: 'rectifyUserName',
                        align: 'center'
                    },
                    {
                        minWidth: 100,
                        title: '整改结束日期',
                        key: 'expirationTime',
                        align: 'center'
                    },
                    {
                        minWidth: 100,
                        title: '整改情况描述',
                        key: 'rectifyDesc',
                        align: 'center',
                        tooltip:true
                    },
                    {
                        minWidth: 120,
                        title: '整改期限',
                        key: 'expectDate',
                        align: 'center'
                    },
                    {
                        minWidth: 100,
                        title: '验证人',
                        key: 'verifierName',
                        align: 'center'
                    },
                    /*{
                        minWidth: 80,
                        title: '照片',
                        key: 'reportFile',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Icon', {
                                    props: {
                                        type: 'md-eye',
                                        size: '20'
                                    },
                                    style: {
                                        marginRight: "0px"
                                    },
                                    on: {
                                        click: () => {
                                            this.viewData(params);
                                        }
                                    }
                                }),
                            ]);
                        }
                    },*/
                    {
                        minWidth: 120,
                        title: '问题状态',
                        align: 'center',
                        key: 'reportStatus',
                        render: (h, params) => {
                            if(params.row.reportStatus == '0'){
                                return h('span',{ },'新建')
                            }else if(params.row.reportStatus == '1'){
                                return h('span',{ },'审核中')
                            }else if(params.row.reportStatus == '2'){
                                return h('span',{ },'待整改')
                            }else if(params.row.reportStatus == '3'){
                                return h('span',{ },'整改中')
                            }else if(params.row.reportStatus == '4'){
                                return h('span',{ },'待验证')
                            }else if(params.row.reportStatus == '5'){
                                return h('span',{ },'验证中')
                            }else if(params.row.reportStatus == '6'){
                                return h('span',{ },'已关闭')
                            }else if(params.row.reportStatus == '7'){
                                return h('span',{ },'验证驳回')
                            }
                        }
                    },
                    {
                        title: '操作',
                        key: 'action',
                        fixed: 'right',
                        width: 120,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('A', {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        fontSize: '14px',
                                    },
                                    on: {
                                        click: () => {
                                            this.viewData(params);
                                        }
                                    }
                                }, '详情'),
                                h('Divider', {
                                    props: {
                                        type: 'vertical',
                                    }
                                }, ''),
                                h('A', {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        fontSize: '14px',
                                        color: params.row.reportStatus == '4'||params.row.reportStatus == '5' ? '' : '#d0d0d0',
                                        pointerEvents: params.row.reportStatus == '4'||params.row.reportStatus == '5' ? '' : 'none'
                                    },
                                    on: {
                                        click: () => {
                                            this.toEdit(params);
                                        }
                                    }
                                }, '验证'),
                            ]);
                        }
                    }
                ],
                ruleCustom: {
                    verifier: [{ required: true,validator: verifierVal, trigger: 'change' }],
                    closedDate: [{required: true, message: '  ', trigger: 'change', type: 'date'}],
                    verifyDate: [{required: true, message: '  ', trigger: 'change', type: 'date'}],
                    verifyResult: [{required: true, message: '  ', trigger: 'change',}],
                },
                dataTable: [],
                model1: false,
                loading: false,tableHeight: '',
                buttonLoading: false,viewModal: false,
                viewForm: {},
                setCurrentVerifierName : {},

                uploadList : [],
                uploadImgs : [],
                fileList : [],
                auditImgs : [],
                visible: false,
                viewUrl : Api.downloadPTWSchemeFile,
                upUrl:Api.uploadPTWFiles,
                editable : false,
                filesUrl : Api.downloadPTWSchemeFile,
            }
        },
        mounted: function () {
            this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 145;
            this.query();
        },
        methods: {

            handleRemove (file) {
                //删除操作
                let _this = this;
                let config = {
                    title: '系统提示',
                    content: '确认删除图片吗?',
                    okText: '确定',
                    cancelText: '取消',
                    onOk: function () {

                        _this.$Spin.show({
                            render: (h) => {
                                return h('div', [
                                    h('Icon', {
                                        'class': 'demo-spin-icon-load',
                                        props: {
                                            type: 'ios-loading',
                                            size: 18
                                        }
                                    }),
                                    h('div', 'Loading')
                                ])
                            }
                        });
                        _this.uploadImgs.splice(_this.uploadImgs.indexOf(file), 1);
                        _this.$http.delete(Api.downloadPTWSchemeFile  + '/' + file.id).then((res) => {
                          /*  _this.$Message.success('删除成功');
                            _this.uploadImgs = [];
                            _this.$http.get(_this.upUrl, {params: {}}).then((res) => {
                                if(res.data.data!=null){
                                    res.data.data.map((item)=>{
                                        _this.uploadImgs.push({ name : item.fileName, id : item.id , url : Api.downloadPTWSchemeFile + '/' + item.id});
                                    });
                                }
                                //this.downloadUrl = this.downloadUrl + '/' + res.data.id;
                            }).catch(e => {
                                console.log(e)
                                this.$Message.error("数据获取失败")
                            })*/

                            _this.$Spin.hide();
                        }).catch(e => {
                            _this.$Spin.hide();
                            _this.$Message.error('删除失败' + e);
                        })
                    },
                    onCancel: function () {
                    }
                }
                this.$Modal.confirm(config);
            },
            handleFormatError (file) {
                this.$Message.error('格式不正确, 请上传 jpg 或 png');
            },
            handleMaxSize (file) {
                this.$Message.error('图片不能大于1M.');
            },
            handleBeforeUpload (file) {
                if(file.size > 1024 * 1024){
                    this.$Message.error('图片不能大于1M.');
                    return false;
                }
                var index = file.name.lastIndexOf(".");
                var suffix = file.name.substr(index+1);

                if(suffix!='jpg' && suffix!='jpeg' && suffix!='png'){
                    this.$Message.error("请上传jpg,jpeg,png格式的图片");
                    return false;
                }
                const check = this.uploadImgs.length < 3;
                if (!check) {
                    this.$Message.error('最多上传3张图片');
                    return false;
                }else {
                    // this.uploadImgs.push(file);
                    let self = this;
                    let keyID = Math.random().toString().substr(2);
                    file['keyID'] = keyID;
                    let reader = new FileReader();
                    reader.readAsDataURL(file);
                    reader.onload = function(ev) { //文件读取成功完成时触发
                        file['imgBase64'] = ev.target.result; //获得文件读取成功后的DataURL,也就是base64编码
                        self.fileList.push(file);
                    }
                }
                return false;
            },
            handleRemove1(keyID){
                this.fileList = this.fileList.filter(item => {
                    return item.keyID != keyID
                })
            },
            handleView (name,url) {
                this.viewUrl = url;
                this.imgName = name;
                this.visible = true;
            },

            viewPicture(row){
                //根据reportFile查询附件
                this.uploadList = [];
                this.$http.get(Api.uploadPTWFiles + '/' + row.reportFile + '/files', {params: {}}).then((res) => {
                    if(res.data.data!=null){
                        res.data.data.map((item)=>{
                            this.uploadList.push({ name : item.fileName, id : item.id , url : Api.downloadPTWSchemeFile + '/' + item.id});
                        });
                    }
                    //this.downloadUrl = this.downloadUrl + '/' + res.data.id;
                }).catch(e => {
                    console.log(e)
                    this.$Message.error("数据获取失败")
                })
            },

            viewAuditPicture(row){
                //根据reportFile查询附件
                this.auditImgs = [];
                this.$http.get(Api.uploadPTWFiles + '/' + row.assignId + '/files', {params: {}}).then((res) => {
                    if(res.data.data!=null){
                        res.data.data.map((item)=>{
                            this.auditImgs.push({ name : item.fileName, id : item.id , url : Api.downloadPTWSchemeFile + '/' + item.id});
                        });
                    }
                    //this.downloadUrl = this.downloadUrl + '/' + res.data.id;
                }).catch(e => {
                    console.log(e)
                    this.$Message.error("数据获取失败")
                })
            },

            handleCancel() {
                this.model1 = false;
            },

            addInfo() {
                this.dataForm = {};
                this.setCurrentVerifierName = {
                    label : JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserName"],
                    value: JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserId"]
                };
                setTimeout(() => {
                    this.$refs.childUser1.setCurrentInfo();
                }, 300);
                this.model1 = true;
            },

            setVerifierName(data) {
                this.dataForm.verifierName = data;
            },
            setVerifierId(data) {
                this.dataForm.verifier = data.userId;
                this.dataForm.verifierName = data.userName;
            },
            pageChange(pageNum) {
                this.pagedata.currentPage = pageNum;
                this.query();
            },
            pageSizeChange(pageSize) {
                this.pagedata.pageSize = pageSize;
                this.query();
            },

            toEdit(params) {
                this.fileList=[]
                this.dataForm = {};
                this.uploadImgs = [];
                this.editable = true;
                let url = Api.toChkProblemVerify + '/' + params.row.problemId;
                this.$http.get(url, {}).then((res) => {

                    this.model1 = true;
                    this.chkProblem = res.data.chkProblem;
                    this.chkAssign = res.data.chkAssign;
                    this.chkRectify = res.data.chkRectify;
                    //this.bohui = res.data.bohui;
                    this.bohui = [];

                    //处理整改图片ID
                    if(this.chkRectify.fileIds!='' && this.chkRectify.fileIds!=null && this.chkRectify.fileIds!=undefined){
                        this.chkRectify.fileIds = this.chkRectify.fileIds.split(';');
                    }

                    if(res.data.chkVerify!=null){
                        this.dataForm = res.data.chkVerify;
                        this.setCurrentVerifierName = { value : res.data.chkVerify.verifier,  label :  res.data.chkVerify.verifierName };

                        //处理验证图片ID
                        if(this.dataForm.fileIds!='' && this.dataForm.fileIds!=null && this.dataForm.fileIds!=undefined){
                            this.dataForm.fileIds = this.dataForm.fileIds.split(';');
                            this.dataForm.fileIds.map((item)=>{
                                this.uploadImgs.push({ name : item, id : item , url : Api.downloadPTWSchemeFile + '/' + item});
                            });
                        }
                    }else {
                        this.dataForm = {};
                        this.setCurrentVerifierName = {
                            label : JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserName"],
                            value: JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserId"]
                        };
                        this.dataForm.verifier = this.setCurrentVerifierName.value;
                        this.dataForm.verifierName = this.setCurrentVerifierName.label;
			            this.uploadImgs = [];
                    }
                    this.dataForm.rectifyUser=params.row.rectifyUser
                    this.dataForm.rectifyUserName=params.row.rectifyUserName
                    this.dataForm.closedDate=new Date();
                    // this.dataForm.verifyDate=new Date();
                    // this.dataForm.verifyResult='1'
                    if(this.chkProblem.reportStatus == '0'){
                        this.chkProblem.reportStatusName = '新建';
                    }else if(this.chkProblem.reportStatus == '1'){
                        this.chkProblem.reportStatusName = '审核中';
                    }else if(this.chkProblem.reportStatus == '2'){
                        this.chkProblem.reportStatusName = '待整改';
                    }else if(this.chkProblem.reportStatus == '3'){
                        this.chkProblem.reportStatusName = '整改中';
                    }else if(this.chkProblem.reportStatus == '4'){
                        this.chkProblem.reportStatusName = '待验证';
                    }else if(this.chkProblem.reportStatus == '5'){
                        this.chkProblem.reportStatusName = '验证中';
                    }else if(this.chkProblem.reportStatus == '6'){
                        this.chkProblem.reportStatusName = '已关闭';
                    }else if(this.chkProblem.reportStatus == '7'){
                        this.chkProblem.reportStatusName = '验证驳回';
                    }
                    setTimeout(() => {
                        this.$refs.childUser1.setCurrentInfo();
                    }, 300);

                    this.viewPicture(this.chkProblem);
                    this.viewAuditPicture(this.chkAssign);
                }).catch(e => {
                    this.$Message.error('请求失败' + e);
                })
            },
            viewData(params) {
                this.editable = false;
                let url = Api.toChkProblemVerify + '/' + params.row.problemId;
                this.$http.get(url, {}).then((res) => {
                    this.viewModal = true;
                    this.chkProblem = res.data.chkProblem;
                    this.chkAssign = res.data.chkAssign;
                    this.chkRectify = res.data.chkRectify;
                    this.bohui = res.data.bohui;

                    if(this.bohui == null){
                        this.bohui = [];
                    }else{
                        let map={
                            chkRectify:{...this.chkRectify},
                            chkVerify:{fileIds:null}
                        }
                        this.bohui.push(map)
                        //处理驳回的图片信息
                        for(let i = 0; i < this.bohui.length; i ++){
                            //处理整改图片ID
                            if(this.bohui[i].chkRectify.fileIds!='' && this.bohui[i].chkRectify.fileIds!=null && this.bohui[i].chkRectify.fileIds!=undefined){
                                this.bohui[i].chkRectify.fileIds =  this.bohui[i].chkRectify.fileIds.split(';');
                            }
                            //处理验证图片ID
                            if( this.bohui[i].chkVerify.fileIds!='' &&  this.bohui[i].chkVerify.fileIds!=null &&  this.bohui[i].chkVerify.fileIds!=undefined){
                                this.bohui[i].chkVerify.fileIds =  this.bohui[i].chkVerify.fileIds.split(';');
                            }else {
                                this.bohui[i].chkVerify.fileIds=[]
                            }
                        }
                    }

                    //处理整改图片ID
                    if(this.chkRectify.fileIds!='' && this.chkRectify.fileIds!=null && this.chkRectify.fileIds!=undefined){
                        this.chkRectify.fileIds =this.chkRectify.fileIds.split(';')
                    }
                    if(res.data.chkVerify!=null){
                        this.viewForm = res.data.chkVerify;
                        //处理验证图片ID
                        if(this.viewForm.fileIds!='' && this.viewForm.fileIds!=null && this.viewForm.fileIds!=undefined){
                            this.viewForm.fileIds = this.viewForm.fileIds.split(';');
                        }
                    }else {
                        this.viewForm = {};
			            this.uploadImgs = [];
                    }

                    if(this.chkProblem.reportStatus == '0'){
                        this.chkProblem.reportStatusName = '新建';
                    }else if(this.chkProblem.reportStatus == '1'){
                        this.chkProblem.reportStatusName = '审核中';
                    }else if(this.chkProblem.reportStatus == '2'){
                        this.chkProblem.reportStatusName = '待整改';
                    }else if(this.chkProblem.reportStatus == '3'){
                        this.chkProblem.reportStatusName = '整改中';
                    }else if(this.chkProblem.reportStatus == '4'){
                        this.chkProblem.reportStatusName = '待验证';
                    }else if(this.chkProblem.reportStatus == '5'){
                        this.chkProblem.reportStatusName = '验证中';
                    }else if(this.chkProblem.reportStatus == '6'){
                        this.chkProblem.reportStatusName = '已关闭';
                    }else if(this.chkProblem.reportStatus == '7'){
                        this.chkProblem.reportStatusName = '验证驳回';
                    }

                    this.viewPicture(this.chkProblem);
                    this.viewAuditPicture(this.chkAssign);

                }).catch(e => {
                    this.$Message.error('请求失败' + e);
                })
            },
            saveData(tag) {
                this.$refs.dataForm.validate((valid) => {
                    if (valid) {
                        let _this = this;
                        let config = {
                            title: '系统提示',
                            content: '提交后不可修改，是否确认提交?',
                            okText: '确定',
                            cancelText: '取消',
                            onOk: function () {
                                _this.buttonLoading=true
                                _this.dataForm.verifyDate = _this.formatDate(new Date(_this.dataForm.verifyDate), 'yyyy-MM-dd');
                                _this.dataForm.closedDate = _this.formatDate(new Date(_this.dataForm.closedDate), 'yyyy-MM-dd');

                                if (tag == '1') {
                                    //保存
                                    _this.dataForm.reportStatus = '5' ;
                                }else if(tag == '2'){
                                    //提交
                                    if(_this.dataForm.verifyResult=='1'){
                                        //验证通过
                                        _this.dataForm.reportStatus = '6' ;
                                    }else{
                                        //验证驳回
                                        _this.dataForm.reportStatus = '7' ;
                                    }
                                }
                                _this.dataForm.problemId = _this.chkProblem.problemId;
                                _this.dataForm.rectifyId = _this.chkRectify.rectifyId;
                                delete _this.dataForm['fileIds'];
                                _this.$http.post(Api.saveOrSubmitChkVerify,  _this.dataForm ).then((res) => {
                                    if(_this.uploadImgs.length>0 ||_this.fileList.length>0){
                                        let formData = new FormData();
                                        for(let i =0;i < _this.uploadImgs.length;i ++){
                                            formData.append("files", _this.uploadImgs[i]);
                                        }
                                        for (let i = 0; i < _this.fileList.length; i++) {
                                            formData.append("files", _this.fileList[i]);
                                        }
                                        _this.$http.post(Api.uploadPTWFiles + '/' + res.data.verifyId + '/files/picture', formData).then((res) => {
                                            if (res.data.result == "success") {
                                                _this.$Message.success("保存成功");
                                                _this.uploadImgs = [];
                                                //_this.uploadList.push(file);
                                                _this.model1 = false;
                                                _this.query();
                                            } else {
                                                _this.$Message.error("附件上传失败");
                                                _this.model1 = false;
                                                _this.query();
                                            } _this.buttonLoading=false
                                        }).catch(e => {
                                            console.log(e);
                                            _this.buttonLoading=false
                                            _this.$Message.error("附件上传失败");
                                        })
                                    }else{
                                        _this.$Message.success("保存成功");
                                        _this.model1 = false;
                                        _this.query();
                                        _this.buttonLoading=false
                                    }
                                }).catch(e => {
                                    _this.model1 = false;
                                    _this.query();
                                    _this.buttonLoading=false
                                    _this.$Message.error("数据保存失败")
                                })
                            },
                            onCancel: function () {
                            }
                        }
                        this.$Modal.confirm(config);

                    } else {
                        this.$Message.error('请填报完整!');
                    }
                })
            },
            query() {
                this.loading = true ;
                //reportStatus 状态值说明 0：新建 1：审核中 2：待整改 3 整改中 4 待验证 5 验证中 6 已关闭 7验证驳回
                if (this.form1.ifverify == '1') {
                    this.form1.reportStatus='6'
                }else {
                    this.form1.reportStatus='4,5'
                }
                let data = {
                    currentPage: this.pagedata.currentPage,
                    size: this.pagedata.pageSize,
                    userId: JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserId"],
                    checkCategory:this.$route.query.id
                }

                data = Object.assign(data, JSON.parse(JSON.stringify(this.form1)));

                let url = Api.getChkProblemVerifyList;
                this.$http.get(url, {params: data}).then((res) => {
                    this.dataTable = res.data.data;
                    this.pagedata.total = res.data.totalSize;this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            reset() {
                this.form1 = {ifverify:'0'};
                this.query();
            },

            formatDate(date, fmt) {
                if (/(y+)/.test(fmt)) {
                    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
                }
                let o = {
                    'M+': date.getMonth() + 1,
                    'd+': date.getDate(),
                    'h+': date.getHours(),
                    'm+': date.getMinutes(),
                    's+': date.getSeconds()
                };
                for (let k in o) {
                    if (new RegExp(`(${k})`).test(fmt)) {
                        let str = o[k] + '';
                        fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.padLeftZero(str));
                    }
                }
                return fmt;
            },
            padLeftZero(str) {
                return ('00' + str).substr(str.length);
            },
            changeSelect(){
                this.pagedata.currentPage = 1;
                this.query();
            },
            switchQuery(flag) {
                this.switchFlag = flag;
                if (!this.switchFlag) {
                    this.tableHeight = this.tableHeight + 44;
                } else {
                    this.tableHeight = this.tableHeight - 44;
                }
            },
        },
    }
</script>
<style lang='css'>
    @import './../../../../index.css';
    .demo-upload-list{
        display: inline-block;
        width: 60px;
        height: 60px;
        text-align: center;
        line-height: 60px;
        border: 1px solid transparent;
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
        position: relative;
        box-shadow: 0 1px 1px rgba(0,0,0,.2);
        margin-right: 4px;
    }
    .demo-upload-list img{
        width: 100%;
        height: 100%;
    }
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .demo-upload-list:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
</style>
